package com.fmsz.physicalheadline.entity.events;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.View;

import com.fmsz.physicalheadline.activitys.event.MatchContentActivity;

import java.util.List;

/**
 * Created by Administrator on 2016/12/20.
 */

public class EventRoot {
    private Data data;

    public Data getData() {
        return data;


    }

    public void setData(Data data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "EventRoot{" +
                "data=" + data +
                '}';
    }

    public class Data {
        private List<Contest_list> contest_list;

        public List<Contest_list> getContest_list() {
            return contest_list;
        }

        public void setContest_list(List<Contest_list> contest_list) {
            this.contest_list = contest_list;
        }

        @Override
        public String toString() {
            return "Data{" +
                    "contest_list=" + contest_list +
                    '}';
        }

        public class Contest_list {
            private Contest contest;
            private long contest_id;
            private int contest_type;

            public int getContest_type() {
                return contest_type;
            }

            public void setContest_type(int contest_type) {
                this.contest_type = contest_type;
            }

            public long getContest_id() {
                return contest_id;
            }

            public void setContest_id(long contest_id) {
                this.contest_id = contest_id;
            }

            public Contest getContest() {
                return contest;
            }

            public void setContest(Contest contest) {
                this.contest = contest;
            }

            @Override
            public String toString() {
                return "Contest_list{" +
                        "contest=" + contest +
                        '}';
            }

            public class Contest {
                private String cup_name, home_scores, away_scores, start_time;
                private H_T h_t;
                private A_T a_t;
                private int status;

                public int getStatus() {
                    return status;
                }

                public void setStatus(int status) {
                    this.status = status;
                }

                public String getCup_name() {
                    return cup_name;
                }

                public void setCup_name(String cup_name) {
                    this.cup_name = cup_name;
                }

                public String getHome_scores() {
                    return home_scores;
                }

                public void setHome_scores(String home_scores) {
                    this.home_scores = home_scores;
                }

                public String getAway_scores() {
                    return away_scores;
                }

                public void setAway_scores(String away_scores) {
                    this.away_scores = away_scores;
                }

                public String getStart_time() {
                    String str = start_time;
                    String strs[] = str.split(" ");
                    return strs[3];
                }

                public void setStart_time(String start_time) {
                    this.start_time = start_time;
                }

                public H_T getH_t() {
                    return h_t;
                }

                public void setH_t(H_T h_t) {
                    this.h_t = h_t;
                }

                public A_T getA_t() {
                    return a_t;
                }

                public void setA_t(A_T a_t) {
                    this.a_t = a_t;
                }

                @Override
                public String toString() {
                    return "Contest{" +
                            "cup_name='" + cup_name + '\'' +
                            ", home_scores='" + home_scores + '\'' +
                            ", away_scores='" + away_scores + '\'' +
                            ", start_time='" + start_time + '\'' +
                            ", h_t=" + h_t +
                            ", a_t=" + a_t +
                            '}';
                }

                public class H_T {
                    private String t_id, name, logo;

                    public String getT_id() {
                        return t_id;
                    }

                    public void setT_id(String t_id) {
                        this.t_id = t_id;
                    }

                    public String getName() {
                        return name;
                    }

                    public void setName(String name) {
                        this.name = name;
                    }

                    public String getLogo() {
                        return logo;
                    }

                    public void setLogo(String logo) {
                        this.logo = logo;
                    }

                    @Override
                    public String toString() {
                        return "H_T{" +
                                "t_id='" + t_id + '\'' +
                                ", name='" + name + '\'' +
                                ", logo='" + logo + '\'' +
                                '}';
                    }
                }

                public class A_T {
                    private String t_id, name, logo;

                    public String getT_id() {
                        return t_id;
                    }

                    public void setT_id(String t_id) {
                        this.t_id = t_id;
                    }

                    public String getName() {
                        return name;
                    }

                    public void setName(String name) {
                        this.name = name;
                    }

                    public String getLogo() {
                        return logo;
                    }

                    public void setLogo(String logo) {
                        this.logo = logo;
                    }

                    @Override
                    public String toString() {
                        return "A_T{" +
                                "t_id='" + t_id + '\'' +
                                ", name='" + name + '\'' +
                                ", logo='" + logo + '\'' +
                                '}';
                    }
                }
            }
            public void clickMatch(View view){
                Context context = view.getContext();
                Intent intent = new Intent(context, MatchContentActivity.class);
                intent.putExtra("contest_id",contest_id);
                intent.putExtra("contest_type",contest_type);
                intent.putExtra("cup_name",contest.cup_name);
                context.startActivity(intent);
            }

        }

    }

}
